Integrand size = 25, antiderivative size = 109 \[ \int \frac {\tan ^2(e+f x)}{\sqrt {a+b \sin ^2(e+f x)}} \, dx=-\frac {\sqrt {\cos ^2(e+f x)} E\left (\arcsin (\sin (e+f x))\left |-\frac {b}{a}\right .\right ) \sec (e+f x) \sqrt {a+b \sin ^2(e+f x)}}{(a+b) f \sqrt {1+\frac {b \sin ^2(e+f x)}{a}}}+\frac {\sqrt {a+b \sin ^2(e+f x)} \tan (e+f x)}{(a+b) f} \]
[Out]
Time = 0.13 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {3275, 482, 437, 435} \[ \int \frac {\tan ^2(e+f x)}{\sqrt {a+b \sin ^2(e+f x)}} \, dx=\frac {\tan (e+f x) \sqrt {a+b \sin ^2(e+f x)}}{f (a+b)}-\frac {\sqrt {\cos ^2(e+f x)} \sec (e+f x) \sqrt {a+b \sin ^2(e+f x)} E\left (\arcsin (\sin (e+f x))\left |-\frac {b}{a}\right .\right )}{f (a+b) \sqrt {\frac {b \sin ^2(e+f x)}{a}+1}} \]
[In]
[Out]
Rule 435
Rule 437
Rule 482
Rule 3275
Rubi steps \begin{align*} \text {integral}& = \frac {\left (\sqrt {\cos ^2(e+f x)} \sec (e+f x)\right ) \text {Subst}\left (\int \frac {x^2}{\left (1-x^2\right )^{3/2} \sqrt {a+b x^2}} \, dx,x,\sin (e+f x)\right )}{f} \\ & = \frac {\sqrt {a+b \sin ^2(e+f x)} \tan (e+f x)}{(a+b) f}-\frac {\left (\sqrt {\cos ^2(e+f x)} \sec (e+f x)\right ) \text {Subst}\left (\int \frac {\sqrt {a+b x^2}}{\sqrt {1-x^2}} \, dx,x,\sin (e+f x)\right )}{(a+b) f} \\ & = \frac {\sqrt {a+b \sin ^2(e+f x)} \tan (e+f x)}{(a+b) f}-\frac {\left (\sqrt {\cos ^2(e+f x)} \sec (e+f x) \sqrt {a+b \sin ^2(e+f x)}\right ) \text {Subst}\left (\int \frac {\sqrt {1+\frac {b x^2}{a}}}{\sqrt {1-x^2}} \, dx,x,\sin (e+f x)\right )}{(a+b) f \sqrt {1+\frac {b \sin ^2(e+f x)}{a}}} \\ & = -\frac {\sqrt {\cos ^2(e+f x)} E\left (\arcsin (\sin (e+f x))\left |-\frac {b}{a}\right .\right ) \sec (e+f x) \sqrt {a+b \sin ^2(e+f x)}}{(a+b) f \sqrt {1+\frac {b \sin ^2(e+f x)}{a}}}+\frac {\sqrt {a+b \sin ^2(e+f x)} \tan (e+f x)}{(a+b) f} \\ \end{align*}
Time = 0.68 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.92 \[ \int \frac {\tan ^2(e+f x)}{\sqrt {a+b \sin ^2(e+f x)}} \, dx=\frac {-2 a \sqrt {\frac {2 a+b-b \cos (2 (e+f x))}{a}} E\left (e+f x\left |-\frac {b}{a}\right .\right )+\sqrt {2} (2 a+b-b \cos (2 (e+f x))) \tan (e+f x)}{2 (a+b) f \sqrt {2 a+b-b \cos (2 (e+f x))}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(221\) vs. \(2(102)=204\).
Time = 2.83 (sec) , antiderivative size = 222, normalized size of antiderivative = 2.04
method | result | size |
default | \(\frac {-\sqrt {-b \left (\cos ^{4}\left (f x +e \right )\right )+\left (a +b \right ) \left (\cos ^{2}\left (f x +e \right )\right )}\, b \left (\cos ^{2}\left (f x +e \right )\right ) \sin \left (f x +e \right )+\sqrt {-b \left (\cos ^{4}\left (f x +e \right )\right )+\left (a +b \right ) \left (\cos ^{2}\left (f x +e \right )\right )}\, \left (a +b \right ) \sin \left (f x +e \right )-a \sqrt {\frac {\cos \left (2 f x +2 e \right )}{2}+\frac {1}{2}}\, \sqrt {-\frac {b \left (\cos ^{2}\left (f x +e \right )\right )}{a}+\frac {a +b}{a}}\, \sqrt {-b \left (\cos ^{4}\left (f x +e \right )\right )+\left (a +b \right ) \left (\cos ^{2}\left (f x +e \right )\right )}\, E\left (\sin \left (f x +e \right ), \sqrt {-\frac {b}{a}}\right )}{\left (a +b \right ) \sqrt {-\left (a +b \left (\sin ^{2}\left (f x +e \right )\right )\right ) \left (\sin \left (f x +e \right )-1\right ) \left (1+\sin \left (f x +e \right )\right )}\, \cos \left (f x +e \right ) \sqrt {a +b \left (\sin ^{2}\left (f x +e \right )\right )}\, f}\) | \(222\) |
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.15 (sec) , antiderivative size = 730, normalized size of antiderivative = 6.70 \[ \int \frac {\tan ^2(e+f x)}{\sqrt {a+b \sin ^2(e+f x)}} \, dx=\frac {2 \, \sqrt {-b \cos \left (f x + e\right )^{2} + a + b} b^{2} \sin \left (f x + e\right ) - {\left (2 i \, \sqrt {-b} b^{2} \sqrt {\frac {a^{2} + a b}{b^{2}}} \cos \left (f x + e\right ) + {\left (2 i \, a b + i \, b^{2}\right )} \sqrt {-b} \cos \left (f x + e\right )\right )} \sqrt {\frac {2 \, b \sqrt {\frac {a^{2} + a b}{b^{2}}} + 2 \, a + b}{b}} E(\arcsin \left (\sqrt {\frac {2 \, b \sqrt {\frac {a^{2} + a b}{b^{2}}} + 2 \, a + b}{b}} {\left (\cos \left (f x + e\right ) + i \, \sin \left (f x + e\right )\right )}\right )\,|\,\frac {8 \, a^{2} + 8 \, a b + b^{2} - 4 \, {\left (2 \, a b + b^{2}\right )} \sqrt {\frac {a^{2} + a b}{b^{2}}}}{b^{2}}) - {\left (-2 i \, \sqrt {-b} b^{2} \sqrt {\frac {a^{2} + a b}{b^{2}}} \cos \left (f x + e\right ) + {\left (-2 i \, a b - i \, b^{2}\right )} \sqrt {-b} \cos \left (f x + e\right )\right )} \sqrt {\frac {2 \, b \sqrt {\frac {a^{2} + a b}{b^{2}}} + 2 \, a + b}{b}} E(\arcsin \left (\sqrt {\frac {2 \, b \sqrt {\frac {a^{2} + a b}{b^{2}}} + 2 \, a + b}{b}} {\left (\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right )\right )}\right )\,|\,\frac {8 \, a^{2} + 8 \, a b + b^{2} - 4 \, {\left (2 \, a b + b^{2}\right )} \sqrt {\frac {a^{2} + a b}{b^{2}}}}{b^{2}}) - 2 \, {\left (2 \, {\left (-i \, a b - i \, b^{2}\right )} \sqrt {-b} \sqrt {\frac {a^{2} + a b}{b^{2}}} \cos \left (f x + e\right ) + {\left (2 i \, a^{2} + i \, a b\right )} \sqrt {-b} \cos \left (f x + e\right )\right )} \sqrt {\frac {2 \, b \sqrt {\frac {a^{2} + a b}{b^{2}}} + 2 \, a + b}{b}} F(\arcsin \left (\sqrt {\frac {2 \, b \sqrt {\frac {a^{2} + a b}{b^{2}}} + 2 \, a + b}{b}} {\left (\cos \left (f x + e\right ) + i \, \sin \left (f x + e\right )\right )}\right )\,|\,\frac {8 \, a^{2} + 8 \, a b + b^{2} - 4 \, {\left (2 \, a b + b^{2}\right )} \sqrt {\frac {a^{2} + a b}{b^{2}}}}{b^{2}}) - 2 \, {\left (2 \, {\left (i \, a b + i \, b^{2}\right )} \sqrt {-b} \sqrt {\frac {a^{2} + a b}{b^{2}}} \cos \left (f x + e\right ) + {\left (-2 i \, a^{2} - i \, a b\right )} \sqrt {-b} \cos \left (f x + e\right )\right )} \sqrt {\frac {2 \, b \sqrt {\frac {a^{2} + a b}{b^{2}}} + 2 \, a + b}{b}} F(\arcsin \left (\sqrt {\frac {2 \, b \sqrt {\frac {a^{2} + a b}{b^{2}}} + 2 \, a + b}{b}} {\left (\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right )\right )}\right )\,|\,\frac {8 \, a^{2} + 8 \, a b + b^{2} - 4 \, {\left (2 \, a b + b^{2}\right )} \sqrt {\frac {a^{2} + a b}{b^{2}}}}{b^{2}})}{2 \, {\left (a b^{2} + b^{3}\right )} f \cos \left (f x + e\right )} \]
[In]
[Out]
\[ \int \frac {\tan ^2(e+f x)}{\sqrt {a+b \sin ^2(e+f x)}} \, dx=\int \frac {\tan ^{2}{\left (e + f x \right )}}{\sqrt {a + b \sin ^{2}{\left (e + f x \right )}}}\, dx \]
[In]
[Out]
\[ \int \frac {\tan ^2(e+f x)}{\sqrt {a+b \sin ^2(e+f x)}} \, dx=\int { \frac {\tan \left (f x + e\right )^{2}}{\sqrt {b \sin \left (f x + e\right )^{2} + a}} \,d x } \]
[In]
[Out]
\[ \int \frac {\tan ^2(e+f x)}{\sqrt {a+b \sin ^2(e+f x)}} \, dx=\int { \frac {\tan \left (f x + e\right )^{2}}{\sqrt {b \sin \left (f x + e\right )^{2} + a}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\tan ^2(e+f x)}{\sqrt {a+b \sin ^2(e+f x)}} \, dx=\int \frac {{\mathrm {tan}\left (e+f\,x\right )}^2}{\sqrt {b\,{\sin \left (e+f\,x\right )}^2+a}} \,d x \]
[In]
[Out]